package com.bwie.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * 
 * @TableName tb_gift
 */
@TableName(value ="tb_gift")
@Data
@Document(indexName = "es_gift",shards = 1,replicas = 0)
public class TbGift implements Serializable {
    /**
     * 礼金ID
     */
    @TableId(type = IdType.AUTO)
    @Id
    @Field(type = FieldType.Keyword)
    private Integer giftId;


    /**
     * 礼金状态0待领取1已领取2未过期3已过期
     */
    @Field(type = FieldType.Integer)
    private Integer giftStatus;

    /**
     * 礼金名称
     */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String giftName;

    /**
     * 礼金logo
     */
    @Field(type = FieldType.Text,index = false)
    private String logo;

    /**
     * 最低消费
     */
    @Field(type = FieldType.Double)
    private BigDecimal minPrice;

    /**
     * 折扣金额
     */
    @Field(type = FieldType.Double)
    private BigDecimal disPrice;

    /**
     * 礼金类型
     */
    @Field(type = FieldType.Integer)
    private Integer giftType;

    /**
     * 开始时间
     */
    @Field(type = FieldType.Date,format = DateFormat.custom,pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date beginTime;

    /**
     * 结束时间
     */
    @Field(type = FieldType.Date,format = DateFormat.custom,pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date endTime;

    /**
     * 创建时间
     */
    @Field(type = FieldType.Date,format = DateFormat.custom,pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date  createTime;

    /**
     * 来源
     */
    @Field(type = FieldType.Integer)
    private Integer giftFrom;

    /**
     * 详细说明
     */

    @Field(type = FieldType.Text,index = false)
    private String giftDesc;

    /**
     * 补充字段，类型名称
     */
    @TableField(exist = false)
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String typeName;

    /**
     * 补充字段，来源名称
     */
    @TableField(exist = false)
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String fromName;


    /**
     * 审计字段
     */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String createBy;

    /**
     * 审计字段
     */
    private String updateBy;


    /**
     * 修改时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss")
    private Date  updateTime;



    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}